package com.ds.infrastructure.hyperspace.console.entity.enums;

public interface TbDeployConfigEnum {
    /**
     * 编辑状态:1(可编辑);2(不可编辑).PS:配置激活后则不可编辑'
     */
    enum EDIT_STATE {
        YES(1, "可编辑"),
        NO(2, "不可编辑");

        public final Integer code;
        private final String desc;

        EDIT_STATE(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static EDIT_STATE toEnum(int value) {
            for (EDIT_STATE item : EDIT_STATE.values()) {
                if (item.code == value) {
                    return item;
                }
            }
            return null;
        }
    }

    /**
     * HOST类型:1(VM);2(Docker)
     */
    enum HOST_TYPE {
        VM(1, "VM"),
        DOCKER(2, "Docker");

        public final Integer code;
        private final String desc;

        HOST_TYPE(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static HOST_TYPE toEnum(int value) {
            for (HOST_TYPE item : HOST_TYPE.values()) {
                if (item.code == value) {
                    return item;
                }
            }
            return null;
        }
    }
}
